/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author thuyhtp_b00491
 */
@Entity
@Table(name = "Event")
@NamedQueries({
    @NamedQuery(name = "Event.findAll", query = "SELECT e FROM Event e"),
    @NamedQuery(name = "Event.findById", query = "SELECT e FROM Event e WHERE e.id = :id"),
    @NamedQuery(name = "Event.findByName", query = "SELECT e FROM Event e WHERE e.name = :name"),
    @NamedQuery(name = "Event.findByIntro", query = "SELECT e FROM Event e WHERE e.intro = :intro"),
    @NamedQuery(name = "Event.findByTopic", query = "SELECT e FROM Event e WHERE e.topic = :topic"),
    @NamedQuery(name = "Event.findBySpeakerOrGuest", query = "SELECT e FROM Event e WHERE e.speakerOrGuest = :speakerOrGuest"),
    @NamedQuery(name = "Event.findByStarttime", query = "SELECT e FROM Event e WHERE e.starttime = :starttime"),
    @NamedQuery(name = "Event.findByCreatetime", query = "SELECT e FROM Event e WHERE e.createtime = :createtime"),
    @NamedQuery(name = "Event.findByPrice", query = "SELECT e FROM Event e WHERE e.price = :price"),
    @NamedQuery(name = "Event.findByApplyProcedure", query = "SELECT e FROM Event e WHERE e.applyProcedure = :applyProcedure"),
    @NamedQuery(name = "Event.findByRequirement", query = "SELECT e FROM Event e WHERE e.requirement = :requirement"),
    @NamedQuery(name = "Event.findByAddress", query = "SELECT e FROM Event e WHERE e.address = :address"),
    @NamedQuery(name = "Event.findByTerm", query = "SELECT e FROM Event e WHERE e.term = :term"),
    @NamedQuery(name = "Event.findByNote", query = "SELECT e FROM Event e WHERE e.note = :note"),
    @NamedQuery(name = "Event.findByImage", query = "SELECT e FROM Event e WHERE e.image = :image")})
public class Event implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "name")
    private String name;
    @Basic(optional = false)
    @Column(name = "intro")
    private String intro;
    @Basic(optional = false)
    @Column(name = "topic")
    private String topic;
    @Basic(optional = false)
    @Column(name = "speaker_or_guest")
    private String speakerOrGuest;
    @Basic(optional = false)
    @Column(name = "starttime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date starttime;
    @Basic(optional = false)
    @Column(name = "createtime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createtime;
    @Basic(optional = false)
    @Column(name = "price")
    private Float price;
    @Basic(optional = false)
    @Column(name = "apply_procedure")
    private String applyProcedure;
    @Basic(optional = false)
    @Column(name = "requirement")
    private String requirement;
    @Basic(optional = false)
    @Column(name = "address")
    private String address;
    @Basic(optional = false)
    @Column(name = "term")
    private String term;
    @Column(name = "note")
    private String note;
    @Basic(optional = false)
    @Column(name = "image")
    private String image;
    @JoinColumn(name = "statusid", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private SeminarStatus seminarStatus;

    

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public String getSpeakerOrGuest() {
        return speakerOrGuest;
    }

    public void setSpeakerOrGuest(String speakerOrGuest) {
        this.speakerOrGuest = speakerOrGuest;
    }

    public Date getStarttime() {
        return starttime;
    }

    public void setStarttime(Date starttime) {
        this.starttime = starttime;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Float getPrice() {
        return price;
    }

    public void setPrice(Float price) {
        this.price = price;
    }

    public String getApplyProcedure() {
        return applyProcedure;
    }

    public void setApplyProcedure(String applyProcedure) {
        this.applyProcedure = applyProcedure;
    }

    public String getRequirement() {
        return requirement;
    }

    public void setRequirement(String requirement) {
        this.requirement = requirement;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getTerm() {
        return term;
    }

    public void setTerm(String term) {
        this.term = term;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public SeminarStatus getSeminarStatus() {
        return seminarStatus;
    }

    public void setSeminarStatus(SeminarStatus seminarStatus) {
        this.seminarStatus = seminarStatus;
    }


    public Event() {
    }

    public Event(String name, String intro, String topic, String speakerOrGuest, Date starttime, Date createtime, Float price, String applyProcedure, String requirement, String address, String term, String note, String image, SeminarStatus seminarStatus) {
        this.name = name;
        this.intro = intro;
        this.topic = topic;
        this.speakerOrGuest = speakerOrGuest;
        this.starttime = starttime;
        this.createtime = createtime;
        this.price = price;
        this.applyProcedure = applyProcedure;
        this.requirement = requirement;
        this.address = address;
        this.term = term;
        this.note = note;
        this.image = image;
        this.seminarStatus = seminarStatus;
    }


   
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Event)) {
            return false;
        }
        Event other = (Event) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Event[id=" + id + "]";
    }

}
